home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir43 / qsrc_dsk.zip / MODEL / WIDGBOUT.TXT < prev    next >
Text File  |  1992-01-15  |  5KB  |  33 lines

  1.  
  2.  WIDGET2, a FoxPro 2 Application written as part of Que Publishing's _Using FoxPro 2_, adds the simple changes needed to use a Foundation READ to the data entry programs and basic procedures in WIDGET.APP.  
  3.  
  4.  It also incorporates many of the other techniques taught in the section of the book beginning with Chapter 14, including a skeletal customized help system, and some example error trapping and logging.  (Hint -- if you want to see the error trapping in full action, you can use the Results menu's Browse option to open the WIDGHELP table; then try to Pack it from the Utilities menu.  This error occurs because WIDGHELP is automatically opened read-only since it is already the active help file.) 
  5.  
  6.  WIDGET2 is designed using a "classic" program structure and flow as described in Chapter 14 and Chapter 16, as you'll find when you investigate WIDGET2.PJX.
  7.  
  8.  All the added subprocedures needed to support this program flow (SETUP, CLEANUP, WIDGHELP, WIDGERROR) are added to the end of WIDGMAIN.
  9.  
  10.  WIDGET2 is still not a real-life application.  It doesn't use all the tables that are part of the Widget system (you'll find their structures in the final Appendix), just the ones which have data entry programs built in the book.  The help system just contains a few entries, with a main entry designed to show an example of an "text-embedded menu" as described in Chapter 15, and others suggesting various ways to evaluate and call the current TOPIC.
  11.  
  12.  Because some of the data entry programs built in the book are direct READs (as required in a FoxApp-generated application like PRODUCT.PJX) and some are indirect (as in the later examples we provide), the error-handling procedures cannot handle multi-user record-locking.  However, they can handle the need to USE EXCLUSIVEly for a Pack or Reindex, so these Utilities options are created from short procedures rather than the native bar names used in WIDGET.APP.
  13.  
  14.  We do not mean to suggest that you should imitate some of our inconsistencies -- the different kinds of READs were provided to give you different examples.  Similarly, you would probably pick *one* of the styles of lookup popups provided in BUDGET.SCX to use for all your lookups, and you would probably settle on a different organization for your WIDGHELP file and procedure.
  15.  
  16.  Here are some other differences you'll find between WIDGET2 and the original WIDGET.APP, and some additional notes on changes made to the projects from the instructions in the book:
  17.  
  18.    Although it only includes one report on the menu, this example allows slightly more flexibility than the one in WIDGET.  Notice that the screen ASK.SCX has been included in WIDGET2.PJX twice, to allow it to be generated both with an .SPR and a .PRG extension (this instruction is saved with the project record for the included file).  The non-default .PRG extension allows it to be called as a UDF().  You'll find an example of this in the "Pack" selection on the WIDGET2 menu.  Ordinarily, if you wanted to use a screen as a UDF you might only include it once and stipulate the .PRG extension.  When you wanted to use it as a procedure you would DO the_scx_name with no extension, like any other PRG.  However, this example allows you to see that a screen might be included several times in a project with different "generate options" each time.
  19.  
  20.    The "About..." option and several others you'd expect to find in a full application have been added -- explore the menus.  Some options that will never function under a READ have been removed.  You'd have to remove still others, replacing them with procedure you'd write, if you planned to run this application under the Distribution Kit.  (Once you've read this text, you will probably want to remove the 
  21.  
  22.  KEYBOARD "{ALT-S}{W}" 
  23.  
  24.  in WIDGMAIN that forces the "About Widget" option to be called at the beginning of the program.)
  25.  
  26.    The unique-id code validation required for the Product table was added to the SCX in use by PRODUCT.APP (the one generated by FoxApp).  Both Widget applications then DO PRODUCT.APP instead of PRODUCT.SPR, to show  how you might include a dependent application in a larger project.  The source code for this dependent application (including both copies of the PRODUCT.SCX) can be found in \MODEL\PRODUCT, since they are not needed by the two Widget applications as long as the PRODUCT.APP file is available.
  27.  
  28.    The simple WAITPAGE() UDF needed by the report included as an example has been revised slightly to allow the pause between pages to be skipped in various situations.  The report option for WIDGET2 incorporates the change by setting a variable to indicate that the pause is required (WIDGET's report menu option does not require a change).
  29.  
  30.    See the Data Path option on the Utility menu in WIDGET2 for other suggested changes to use this application in the "real world".  There are other small changes scattered throughout the applications you'll notice if you "dig" a little as you follow the text. ;-)
  31.  
  32.  (For more information on purchasing the book, see the file QDISTRIB.TXT, in your main directory for the book's files.  It contains a list of phone numbers and distributors.  If you are using the shareware version of the source code disk, see the file QDISK.TXT in your main source disk directory for information on registering the disk and receiving additional sample programs.)
  33.